package edu.sias;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.TimeZone;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })

public class HYZNApplication
{
    public static void main(String[] args) throws UnknownHostException {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ConfigurableApplicationContext application = SpringApplication.run(HYZNApplication.class, args);
        System.out.println("\n\033[0;36m" + // 蓝色调
                "(♥◠‿◠)ﾉﾞ  慧眼智能系统启动成功  ლ(´ڡ`ლ)ﾞ  \033[0m\n" +
                "  ╔════════════════════════╗\n" +
                "  ║\033[1;34m       系统版本v1.0      \033[0m║\n" +

                "  ╚════════════════════════╝\n");


        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        Environment env = application.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        System.out.print("\n----------------------------------------------------------\n\t" +
                "Application is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port  + "/\n\t" +
                "External: \thttp://" + ip + ":" + port  + "/\n\t" +
                "接口文档: \thttp://" + ip + ":" + port  + "/doc.html\n\t");

    }
}
